// Win32ConsoleApp.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
using namespace std;

#define printFunName()	(cout<<__FUNCTION__<<endl)

class CBase
{
public:
	CBase(){m_nVal = 9;}
	virtual void	PrintValue()
	{
		printFunName();
		m_nVal++;
		cout<<"Value = "<<m_nVal<<endl;
	}
protected:
	int m_nVal;
};

class CMyObject : public CBase
{
public:
	CMyObject():CBase(){}
	virtual void	PrintValue()
	{
		printFunName();
		CBase::PrintValue();
	}
};

int _tmain(int argc, _TCHAR* argv[])
{
	CMyObject myObj;
	CBase &base = myObj;
	base.PrintValue();
	return 0;
}

